home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / qlib205.zip / QLIB.ZIP / TEST / TIMEDATE.C < prev    next >
C/C++ Source or Header  |  1997-02-11  |  644b  |  22 lines

  1. #include <qlib.h>
  2. #include <stdio.h>
  3. #include <dos.h>
  4.  
  5. struct time t1,t2={59,11,99,59};
  6. struct date d1,d2={1980,24,12};
  7.  
  8. void main(void) {
  9.   gettime(&t1);
  10.   getdate(&d1);
  11.   printf("The date is:%d/%d/%d\n",d1.da_mon,d1.da_day,d1.da_year);
  12.   printf("The time is:%d:%d:%d.%d\n",t1.ti_hour,t1.ti_min,t1.ti_sec,t1.ti_hund);
  13.   settime(&t2);
  14.   setdate(&d2);
  15.   printf("Time changed!\n");
  16.   printf("The date is:%d/%d/%d\n",d2.da_mon,d2.da_day,d2.da_year);
  17.   printf("The time is:%d:%d:%d.%d\n",t2.ti_hour,t2.ti_min,t2.ti_sec,t2.ti_hund);
  18.   settime(&t1);
  19.   setdate(&d1);
  20.   printf("Don't worry, time was reset back to normal ;)\n");
  21. }
  22.